package com.magnusart.scrumppm.model;

import static org.junit.Assert.assertTrue;

import org.junit.Before;
import org.junit.Test;

public class ProjectSpecification extends BaseSpecification<Project>
{
	
	private ProjectBuilder builder;

	@Before
	public void setupClass() {
		builder = new ProjectBuilder();
		builder.setName( "Project" );
		builder.setDescription( "Description" );
		
		x = new Project( builder );
		y = new Project( builder );
		z = new Project( builder );
		
		builder.setName( "Project1" );
		builder.setDescription( "Description2" );
		
		a = new Project( builder );
	}
	
	@Test(expected=IllegalStateException.class)
	public void projectBuilderMustBeReady() throws Exception {
		ProjectBuilder builder = new ProjectBuilder();
		new Project( builder );
	}

	@Test
	public void projectBuiltFromProjectShouldBeEqual() throws Exception {
		Project proj = new Project(  builder );
		Project proj2 = new Project( builder );
		assertTrue( proj.equals( proj2 ) );
	}
}
